const Mock = require('mockjs')

const List5 = []
const count5 = 1
for (let i = 0; i < count5; i++) {
  List5.push(Mock.mock({
    id: '@id',
    test_time: '@datetime'
  }))
}

const data5 = Mock.mock({
  chip_id: '@id',
  name: '@title(5, 10)',
  supplier: '@title(1, 3)',
  chip_no: +Mock.Random.date('T'),
  raycus_no: +Mock.Random.date('T'),
  test_time: '@datetime',
  test_content: '@title(5, 10)',
  module_type: '@title(1, 3)',
  description: '@title(10, 50)',
  report_file_url: 'http://192.168.0.11/file/download/器件验证报告.xlxs',
  params: {
    fac_coupling: [
      { pId: 1, item: 'FAC耦合', parameter: '质心Y', symbol: 'CenY', unit: '/', test_condition: '', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 2, item: 'FAC耦合', parameter: 'Y宽', symbol: 'W-CenY', unit: '/', test_condition: '', min_value: '0', typical_value: '5', max_value: '10' }
    ],
    reflector_coupling: [
      { pId: 4, item: '反射镜耦合', parameter: '空对功率', symbol: 'Pnonl', unit: 'W', test_condition: '', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 5, item: '反射镜耦合', parameter: '压胶功率', symbol: 'Pglue', unit: 'W', test_condition: '', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 6, item: '反射镜耦合', parameter: '耦合效率', symbol: 'ηcop', unit: '%', test_condition: '', min_value: '0', typical_value: '5', max_value: '10' }
    ],
    series_power_test: [
      { pId: 8, item: '串联测试', parameter: '工作电流', symbol: 'Iop', unit: 'A', test_condition: '25℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '串联测试', parameter: '工作功率', symbol: 'Pop', unit: 'W', test_condition: '25℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '串联测试', parameter: '工作电压', symbol: 'Vop', unit: 'V', test_condition: '25℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 7, item: '串联测试', parameter: '工作波长', symbol: 'λ', unit: 'nm', test_condition: '25℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '串联测试', parameter: '波长差', symbol: 'Δλ5', unit: 'nm', test_condition: '25℃', min_value: '0', typical_value: '5', max_value: '10' }
    ],
    reliability_test: [
      { pId: 10, item: '可靠性测试', parameter: '温循', symbol: 'Thc', unit: '/', test_condition: '零下40℃至85℃', min_value: '0', typical_value: '5', max_value: '10' }
    ],
    final_test: [
      { pId: 10, item: '终测', parameter: '终测功率', symbol: 'Pfinal', unit: 'W', test_condition: '25℃', min_value: '0', typical_value: '5', max_value: '10' }
    ]
  }
})

module.exports = [
  {
    url: '/test_report/history',
    type: 'get',
    response: config => {
      const { chipId } = config.query
      console.log('chipId', chipId)
      return {
        code: 0,
        data: List5
      }
    }
  },
  {
    url: '/test_report/info',
    type: 'get',
    response: config => {
      const { testTime } = config.query
      console.log('testTime', testTime)
      return {
        code: 0,
        data: data5
      }
    }
  }
]

